﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ZhimeiSoft.CharmManager.Server.DAL
{
    public class EmployeeVacationDAL_Const
    {
        
        public static readonly string SQL_SELECT_EMPLOYEEVACATION = @"SELECT EMPLOYEEID,VSTATE,VSTARTDATETIME,VENDDATETIME FROM EMPLOYEEVACATION";

        public static readonly string SQL_DELETE_EMPLOYEEVACATION = @"DELETE FROM EMPLOYEEVACATION WHERE EMPLOYEEID = @EMPLOYEEID AND VSTATE = @VSTATE AND VSTARTDATETIME = @VSTARTDATETIME AND VENDDATETIME = @VENDDATETIME";
        
        public static readonly string SQL_INSERT_EMPLOYEEVACATION = @"INSERT INTO EMPLOYEEVACATION (EMPLOYEEID,VSTATE,VSTARTDATETIME,VENDDATETIME) VALUES (@EMPLOYEEID, @VSTATE, @VSTARTDATETIME, @VENDDATETIME)";

        public static readonly string SQL_UPDATE_EMPLOYEEVACATION = @"UPDATE EMPLOYEEVACATION SET EMPLOYEEID = @EMPLOYEEID_NEW, VSTATE = @VSTATE_NEW, VSTARTDATETIME = @VSTARTDATETIME_NEW, VENDDATETIME = @VENDDATETIME_NEW
            WHERE EMPLOYEEID = @EMPLOYEEID AND VSTATE = @VSTATE AND VSTARTDATETIME = @VSTARTDATETIME AND VENDDATETIME = @VENDDATETIME";

        public static readonly string SQL_QUERY_EMPLOYEEVACATION_DATETIME = @"SELECT A.EMPLOYEEID, A.ENAME, A.ECODE, B.VSTARTDATETIME,B.VENDDATETIME, B.VSTATE FROM EMPLOYEEINFO A, EMPLOYEEVACATION B 
            WHERE A.EMPLOYEEID = B.EMPLOYEEID AND B.VSTARTDATETIME >= @VSTARTDATETIME AND B.VENDDATETIME <= @VENDDATETIME";

        public static readonly string SQL_QUERY_EMPLOYEEVACATION_DATETIME_EMPLOYEEID = @"SELECT A.EMPLOYEEID, A.ENAME, A.ECODE, B.VSTARTDATETIME,B.VENDDATETIME, B.VSTATE FROM EMPLOYEEINFO A, EMPLOYEEVACATION B 
            WHERE A.EMPLOYEEID = B.EMPLOYEEID AND B.VSTARTDATETIME >= @VSTARTDATETIME AND B.VENDDATETIME <= @VENDDATETIME AND A.EMPLOYEEINFO = @EMPLOYEEID";

        public static readonly string SQL_QUERY_EMPLOYEEVACATION_DATETIME_DAY = @"SELECT A.EMPLOYEEID, A.ENAME, A.ECODE, B.VSTARTDATETIME,B.VENDDATETIME, B.VSTATE FROM EMPLOYEEINFO A, EMPLOYEEVACATION B 
            WHERE A.EMPLOYEEID = B.EMPLOYEEID AND B.VSTARTDATETIME <= @QUERYTIME AND B.VENDDATETIME >= @QUERYTIME ";

        public static readonly string SQL_QUERY_EMPLOYEEVACATION_DATETIME_DAYA_STATE = @"SELECT A.EMPLOYEEID, A.ENAME, A.ECODE, B.VSTARTDATETIME,B.VENDDATETIME, B.VSTATE FROM EMPLOYEEINFO A, EMPLOYEEVACATION B 
            WHERE A.EMPLOYEEID = B.EMPLOYEEID AND B.VSTARTDATETIME <= @QUERYTIME AND B.VENDDATETIME >= @QUERYTIME AND B.VSTATE = @VSTATE";

        //public static readonly string SELECT A.EMPLOYEEID, A.ECODE, A.ENAME, B.* FROM EMPLOYEEINFO A, EMPLOYEEVACATION B
    //WHERE A.EMPLOYEEID = B.EMPLOYEEID AND B.VSTATE = 'VOA' AND B.VSTARTDATETIME


    }
}
